<template>
  <div>
    <router-link :to="info.url">>>>返回列表</router-link>
    <div class="box">
      <h1>{{ info2.title }}</h1>
      <p>{{ info2.content }}</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      info: {},
      info2: {},
    };
  },
  created() {
    this.info = this.$store.state.category.find((item) => {
      return item.id === parseInt(this.$route.params.id);
    });
    this.info2 = this.info.blogs.find(
      (item) => item.id === parseInt(this.$route.params.bid)
    );
    console.log(this.info2);
  },
};
</script>

<style lang="scss" scoped>
.box {
  text-align: center;
  p{
    margin-top: 20px;
    font-size: 20px;
  }
}
</style>